export function copyArrayElements<T>(src: T[] | Uint8Array, srcPos: number, dest: T[] | Uint8Array, destPos: number, length: number) {
    for (let i = 0; i < length; ++i) {
        dest[destPos + i] = src[srcPos + i];
    }
}

export function copyArray<T>(src: T[]) {
    const dest: T[] = new Array(src.length);
    for (let i = 0; i < src.length; i++) {
        dest[i] = src[i];
    }
    return dest;
}

export function isIE() {
    return (/msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent));
}